﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core.Module.Interfaces.Model;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Xml;

namespace Core.Module.Model
{
    [Serializable]
    [XmlRoot("node")]
   public class ModuleNode:IModuleNode, IXmlSerializable
    {
       public string Id { get; set; }
       public string Alias { get; set; }
       public string Name { get; set; }
       public string Title { get; set; }

       public object Data { get; set; }
       
       public string SiteId { get; set; }

       public string Path { get; set; }
       public string[] Parents { get; set; }
       
       public string Url { get; set; }
       public string Icon { get; set; }

       public XmlSchema GetSchema()
       {
           return null;
       }

       public void ReadXml(System.Xml.XmlReader reader)
       {
           throw new NotImplementedException();
       }

       public void WriteXml(XmlWriter writer)
       {
           writer.WriteAttributeString("id", Id);
           writer.WriteAttributeString("alias", Alias);
           writer.WriteAttributeString("title", Title);
           writer.WriteAttributeString("siteid", SiteId);
           writer.WriteAttributeString("path", Path);
           writer.WriteAttributeString("url", Url);
           writer.WriteAttributeString("icon", Icon);
       }
    }
}
